var url ="myPlacesAjax";
$.getJSON(url, function(data) {
	for(var i=0;i<data.places.length;i++){
		var latlng2 = new google.maps.LatLng(data.places[i].latitud,data.places[i].longitud);

		var marker2 = new google.maps.Marker({
			position: latlng2,
			title:data.places[i].title,
			zIndex:parseInt(data.places[i].id),
		}); 
		marker2.setMap(map);
		
		google.maps.event.addListener(marker2, 'click', function(){
				ver_detalles(this.zIndex);		
		});
		
	}
		
});
function ver_detalles(id){
	window.location = 'details/'+id;
}
